<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -->
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <h1 id="tip1"></h1>
    <h1 id="tip2"></h1>
    <img src="./位图/1.jpg" alt="" />
    <img src="./位图/2.jpg" alt="" />
    <img src="./位图/3.jpg" alt="" />
    <img src="./位图/4.jpg" alt="" />
    <script>
      // 移动端获取布局视口: document.documentElement.clientWidth
      // 移动端获取视觉视口: window.innerWidth
      // 注意: 缩放移动端页面,布局视口不变,改变的是视觉视口
      setInterval(() => {
        tip1.innerText = '布局视口:' + document.documentElement.clientWidth
        tip2.innerText = '视觉视口:' + window.innerWidth
      }, 50)
    </script>
  </body>
</html>
